using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;

namespace Wootbar
{
    static class WebHelper
    {
        public static string GetRawData(string strURL)
        {
            try
            {
                // Get the webpage and parse it.
                WebResponse objResponse;
                WebRequest objRequest = System.Net.HttpWebRequest.Create(strURL);
                objResponse = objRequest.GetResponse();

                string strResult;
                using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
                {
                    // Read in the whole stream
                    strResult = sr.ReadToEnd();
                    // Close and clean up the StreamReader
                    sr.Close();
                }
                strResult = strResult.Replace("\n", "");
                strResult = strResult.Replace("\t", "");
                strResult = strResult.Replace("\r", "");
                return (strResult);
            }
            catch (Exception ex)
            {
                return (ex.Message);
            }
        }

    }
}
